<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 11-8-16
  Time: 下午11:48
--%>
<%@page pageEncoding="UTF-8" %>
<%@page import="org.free.example.zxing.EncoderQRCode" %>
<%@page import="java.io.OutputStream" %>
<%@page import="org.base64.Base64" %>
<%
    OutputStream outStream = null;
    try{
        outStream = response.getOutputStream();
    }catch (Exception e){
        e.printStackTrace();
    }

    if(outStream != null){
        EncoderQRCode handler = new EncoderQRCode();
        handler.encodeByStream("测试一下", 300, 300, outStream);

        out.clear();
        out = pageContext.pushBody();
    }

    response.setContentType("image/png");
    response.flushBuffer();
%>